package com.stylefeng.guns.common.constant.state;

/**
 * 订单的状态  -1无效订单,0-意向订单,1-待预埋,2-待安装,3-安装完成
 * @author zhouh
 * @Date 2017年1月22日 下午12:14:59
 */
public enum OrderInfoStatus {

    WUXIAO(-1, "无效订单"),
    YIXIANG(0, "意向订单"),
    DAIYUMAI(1, "待预埋"),
    DAIANZHUANG(2, "待安装"),
    WANCHENG(3, "安装完成");

    int code;
    String message;

    OrderInfoStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (OrderInfoStatus s : OrderInfoStatus.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
